package case13

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Test() {

	fmt.Println("🎯示例十三：获取path参数")

	r := gin.Default()

	// path 路径传参没有默认参数项，他是url路径传递！
	r.GET("/userSearch/:name/:age", func(c *gin.Context) {
		name := c.Param("name")
		age := c.Param("age")

		c.JSON(http.StatusOK, gin.H{
			"name": name,
			"age":  age,
		})
	})

	r.Run(":60000")
}
